/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author 7P7
 */
@Entity
@Table(name = "PrizeCategory", catalog = "NationalLevelPaperPresentation", schema = "dbo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "PrizeCategory.findAll", query = "SELECT p FROM PrizeCategory p"),
    @NamedQuery(name = "PrizeCategory.findByPrizeCateID", query = "SELECT p FROM PrizeCategory p WHERE p.prizeCateID = :prizeCateID"),
    @NamedQuery(name = "PrizeCategory.findByPrizeCateName", query = "SELECT p FROM PrizeCategory p WHERE p.prizeCateName = :prizeCateName")})
public class PrizeCategory implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "PrizeCateID", nullable = false)
    private Integer prizeCateID;
    @Size(max = 150)
    @Column(name = "PrizeCateName", length = 150)
    private String prizeCateName;
    @OneToMany(mappedBy = "prizeCateID")
    private Collection<Prize> prizeCollection;

    public PrizeCategory() {
    }

    public PrizeCategory(Integer prizeCateID) {
        this.prizeCateID = prizeCateID;
    }

    public Integer getPrizeCateID() {
        return prizeCateID;
    }

    public void setPrizeCateID(Integer prizeCateID) {
        this.prizeCateID = prizeCateID;
    }

    public String getPrizeCateName() {
        return prizeCateName;
    }

    public void setPrizeCateName(String prizeCateName) {
        this.prizeCateName = prizeCateName;
    }

    @XmlTransient
    public Collection<Prize> getPrizeCollection() {
        return prizeCollection;
    }

    public void setPrizeCollection(Collection<Prize> prizeCollection) {
        this.prizeCollection = prizeCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (prizeCateID != null ? prizeCateID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PrizeCategory)) {
            return false;
        }
        PrizeCategory other = (PrizeCategory) object;
        if ((this.prizeCateID == null && other.prizeCateID != null) || (this.prizeCateID != null && !this.prizeCateID.equals(other.prizeCateID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.PrizeCategory[ prizeCateID=" + prizeCateID + " ]";
    }
    
}
